﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>GD库函数综合使用实例</title>
</head>
<body>
<?php
	header("Content-type: image/png");
	$im = imagecreatetruecolor(400, 35);
	$col = imagecolorallocate($im, 240, 240, 240);
	imagefill($im,0,0,$col);
	$red = imagecolorallocate($im, 250, 0, 0);
	$black = imagecolorallocate($im, 0, 0, 0);
	$text = 'Testing...';
	$font = 'simhei.ttf';
	imagettftext($im, 20, 0, 11, 26, $red, $font, $text);
	imagettftext($im, 20, 0, 10, 25, $black, $font, $text);
	ob_clean();  
	flush();
	imagepng($im);
	imagedestroy($im);
?>
</body>
</html>